package com.rgs.se.design.proxy.dynamic;

import java.lang.reflect.Proxy;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author Ren Gaoshuai
 * @date 2021-07-19 14:41
 **/
public class TestMain {

    public static void main(String[] args) {

        //创建对应的三个对象
        WorkInterface javaEngineer = new JavaEngineer();
        WorkInterface htmlEngineer = new HtmlEngineer();
        WorkInterface pythonEngineer = new PythonEngineer();

        //创建代理类
        ProxyHandler proxyHandler = new ProxyHandler();

        //传入具体的对象，生成代理
        WorkInterface proxy =(WorkInterface) proxyHandler.bind(pythonEngineer);

        proxy.goToWork();
        proxy.goOffWork();

    }
}
